package com.example.springmvcproject.Vo;


import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.hibernate.validator.constraints.Length;
import org.hibernate.validator.constraints.NotBlank;

import javax.validation.constraints.Pattern;
import java.io.Serializable;

@Data
@AllArgsConstructor
@NoArgsConstructor
public class UserVo implements Serializable {

    @NotBlank(message = "账号不能为空")
    @Length(min = 6,max = 16,message = "账号需要在6~16个字符之间")
    @Pattern(regexp = "^[\\dA-Za-z]+$" ,message = "账号不能有特殊符号")
    private String account;

    @NotBlank(message = "密码不能为空")
    @Length(min = 8,max = 16,message = "密码需要在8~16个字符之间")
    @Pattern(regexp = "^[A-Z][\\dA-Za-z]+$" ,message = "密码需要首字母大写，且为字母数字的组合")
    private String password;

    private Boolean remember=false;//是否记住我
}
